<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 */
global $woo_options, $loop, $wp_query;

get_header(); ?>
    
<?php woo_main_before();

$wp_query = new WP_Query(array(
    'post_type' => 'san-pham',
    'orderby' => 'date',
    'order' => 'desc',
    'posts_per_page' => $woo_options['woo_products_per_page'],
    'paged' => ( get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1 ),
    'status' => array('publish','private'),
    's' => get_query_var('s')
));
?>

<div class="row-fluid">
	<div class="span3 sidebar-left-col">
		<?php get_sidebar("left")?>
	</div>
	 
	<div id="wrap-list-product" class="span9">
		<div id="category-product" class="wrap-products">
			<div class="products">
				<?php $loop=1; while($wp_query->have_posts()) { $wp_query->the_post();?>
				    <?php get_template_part("content","product");?>
                    <?php if($loop%4==0){?>
                    <div class="clearfix"></div>
                    <?php } ?>    
				<?php  $loop++; } ?>
			</div>
			<div class="clearfix"></div>
			
            <hr />
			<div class="ar navigation">
				<?php woo_pagination(array('type' => 'list'));?>
			</div>
		</div>
		<?php wp_reset_query();?>
	</div>
</div>

<?php woo_main_after();?>

<?php get_footer(); ?>